home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / refer-tools / ref2bib.sed < prev    next >
Text File  |  1994-11-13  |  4KB  |  201 lines

  1. #
  2. # sed script to do some of the ref to bib database conversion
  3. #
  4. # written by Peter King, Heriot-Watt University
  5. # You may do anything you like with this code
  6. # EXCEPT claim that you wrote it
  7. #
  8. # First alter the TeX special characters
  9. s/\(.\)%/\1\\%/g
  10. s/&/\\&/g
  11. s/\$/\\$/g
  12. s/#/\\#/g
  13. s/_/\\_/g
  14. s/{/\\{/g
  15. s/}/\\}/g
  16. # convert the special characters and accents from troff to BibTeX
  17. # assumes the accents are those of the Berkeley -ms with .AM
  18. #
  19. /\\/s/\(.\)\\\\*\*'/{\\'\1}/g
  20. /\\/s/\(.\)\\\\*\*`/{\\`\1}/g
  21. /\\/s/\(.\)\\\\*\*^/{\\^\1}/g
  22. /\\/s/\(.\)\\\\*\*:/{\\"\1}/g
  23. /\\/s/\(.\)\\\\*\*~/{\\~\1}/g
  24. /\\/s/\(.\)\\\\*\*_/{\\=\1}/g
  25. /\\/s/\([oO]\)\\\\*\*\//{\\\1}/g
  26. /\\/s/\([aA]\)\\\\*\*o/{\\\1\1}/g
  27. /\\/s/\(.\)\\\\*\*,/{\\c{\1}}/g
  28. /\\/s/\(.\)\\\\*\*v/{\\v{\1}}/g
  29. /\\/s/\(.\)\\\\*\*"/{\\H{\1}}/g
  30. /\\/s/\(.\)\\\\*\*\./{\\d{\1}}/g
  31. /\\/s/\\\\*\*8/{\\ss}/g
  32. /\\/s/\\\\*\*(P\([lL]\)/{\\\1}/g
  33. /\\/s/\\\\*\*(\([oO]\)\//{\\\1}/g
  34. # quotes
  35. /\\/s/\\\\*\*Q/``/g
  36. /\\/s/\\\\*\*U/''/g
  37. /\\/s/\\\\*\*-/---/g
  38. # \0 as space between surname de\0Souza etc.
  39. /\\/s/\\\\*0\([a-z]*\)\\\\*0/\\0\1 /g
  40. /\\/s/ \([a-z]*\)\\\\*0/ \1 /g
  41. # but trap the ones that start with a capital letter and convert them to
  42. # ties
  43. /\\/s/\\\\*0/~/g
  44. #
  45. # now deal with special characters and Greek
  46. /\\/s/\\\\*(em/---/g
  47. /\\/s/\\\\*(if/$\\infty$/g
  48. /\\/s/\\\\*(\*a/$\\alpha$/g
  49. /\\/s/\\\\*(\*b/$\\beta$/g
  50. /\\/s/\\\\*(\*g/$\\gamma$/g
  51. /\\/s/\\\\*(\*d/$\\delta$/g
  52. /\\/s/\\\\*(\*e/$\\epsilon$/g
  53. /\\/s/\\\\*(\*z/$\\zeta$/g
  54. /\\/s/\\\\*(\*y/$\\eta$/g
  55. /\\/s/\\\\*(\*h/$\\theta$/g
  56. /\\/s/\\\\*(\*i/$\\iota$/g
  57. /\\/s/\\\\*(\*k/$\\kappa$/g
  58. /\\/s/\\\\*(\*l/$\\lambda$/g
  59. /\\/s/\\\\*(\*m/$\\mu$/g
  60. /\\/s/\\\\*(\*n/$\\nu$/g
  61. /\\/s/\\\\*(\*c/$\\xi$/g
  62. /\\/s/\\\\*(\*o/$o$/g
  63. /\\/s/\\\\*(\*p/$\\pi$/g
  64. /\\/s/\\\\*(\*r/$\\rho$/g
  65. /\\/s/\\\\*(\*s/$\\sigma$/g
  66. /\\/s/\\\\*(\*t/$\\tau$/g
  67. /\\/s/\\\\*(\*u/$\\upsilon$/g
  68. /\\/s/\\\\*(\*f/$\\phi$/g
  69. /\\/s/\\\\*(\*x/$\\chi$/g
  70. /\\/s/\\\\*(\*q/$\\psi$/g
  71. /\\/s/\\\\*(\*w/$\\omega$/g
  72. /\\/s/\\\\*(\*A/A/g
  73. /\\/s/\\\\*(\*B/B/g
  74. /\\/s/\\\\*(\*G/$\\Gamma$/g
  75. /\\/s/\\\\*(\*D/$\\Delta$/g
  76. /\\/s/\\\\*(\*E/E/g
  77. /\\/s/\\\\*(\*Z/Z/g
  78. /\\/s/\\\\*(\*Y/H/g
  79. /\\/s/\\\\*(\*H/$\\Theta$/g
  80. /\\/s/\\\\*(\*I/I/g
  81. /\\/s/\\\\*(\*K/K/g
  82. /\\/s/\\\\*(\*L/$\\Lambda$/g
  83. /\\/s/\\\\*(\*M/M/g
  84. /\\/s/\\\\*(\*N/N/g
  85. /\\/s/\\\\*(\*C/$\\Xi$/g
  86. /\\/s/\\\\*(\*O/$O$/g
  87. /\\/s/\\\\*(\*P/$\\Pi$/g
  88. /\\/s/\\\\*(\*R/P/g
  89. /\\/s/\\\\*(\*S/$\\Sigma$/g
  90. /\\/s/\\\\*(\*T/T/g
  91. /\\/s/\\\\*(\*U/$\\Upsilon$/g
  92. /\\/s/\\\\*(\*F/$\\Phi$/g
  93. /\\/s/\\\\*(\*X/X/g
  94. /\\/s/\\\\*(\*Q/$\\Psi$/g
  95. /\\/s/\\\\*(\*W/$\\Omega$/g
  96. # Now trap title words that must be capitalised
  97. /^%[^T]/b
  98. #
  99. # first all words that are all capitals (at least two consecutive)
  100. # we need the slashes to allow for M/M/1 queues
  101. s;[A-Z][A-Z/][A-Z/0-9]*;{&};g
  102. #
  103. # then some proper names
  104. # first some mathematicians
  105. # (for some I've added the Pattern [^ -]* toe the end to get Markov,
  106. # Markovian, etc.
  107. s/Abel/{&}/g
  108. s/Bernoulli/{&}/g
  109. s/Bessel/{&}/g
  110. s/Beta/{&}/g
  111. s/Borel/{&}/g
  112. s/Cauchy/{&}/g
  113. s/Church/{&}/g
  114. s/Rosser/{&}/g
  115. s/Dedekind/{&}/g
  116. s/Descartes/{&}/g
  117. s/Dirichlet/{&}/g
  118. s/Euclid[^ -,;]*/{&}/g
  119. s/Euler/{&}/g
  120. s/Fibonacci/{&}/g
  121. s/Fermat/{&}/g
  122. s/Fourier/{&}/g
  123. s/Fresnel/{&}/g
  124. s/Frobenius/{&}/g
  125. s/Perron/{&}/g
  126. s/Gamma/{&}/g
  127. s/Gauss[^ -,;]*/{&}/g
  128. s/Hilbert/{&}/g
  129. s/Horner/{&}/g
  130. s/Holder/{&}/g
  131. s/Jacobi[^ -,;]*/{&}/g
  132. s/Jensen/{&}/g
  133. s/Markov[^ -,;]*/{&}/g
  134. s/Arnoldi/{&}/g
  135. s/Laplace/{&}/g
  136. s/Laguerre/{&}/g
  137. s/Lagrange/{&}/g
  138. s/Legendre/{&}/g
  139. s/Leibnitz/{&}/g
  140. s/Rayleigh/{&}/g
  141. s/Ritz/{&}/g
  142. s/Riemann/{&}/g
  143. # this is really Rouche (acute accent) , but the accent processing will disrupt it
  144. s/Rouch/{&}/g
  145. s/Stieltjes/{&}/g
  146. s/Stiener/{&}/g
  147. s/Schwarz/{&}/g
  148. s/Weibull/{&}/g
  149. s/Wald/{&}/g
  150. s/Kronecker/{&}/g
  151. s/Diophantine/{&}/g
  152. s/Delbrouck/{&}/g
  153. s/Bayes[^ -,;]*/{&}/g
  154. s/Jackson/{&}/g
  155. s/Newhall/{&}/g
  156. s/Turing/{&}/g
  157. s/Norton/{&}/g
  158. s/Petri/{&}/g
  159. s/Wilkinson/{&}/g
  160. s/Skinner/{&}/g
  161. s/Schafer/{&}/g
  162. s/Dempster/{&}/g
  163. s/Runge/{&}/g
  164. s/Kutta/{&}/g
  165. s/Pollaczek/{&}/g
  166. s/Khinchin/{&}/g
  167. s/Palm/{&}/g
  168. s/Erlang/{&}/g
  169. s/Engset/{&}/g
  170. s/Little's/{&}/g
  171. s/Kosten/{&}/g
  172. s/Gittins/{&}/g
  173. s/Feller/{&}/g
  174. s/Cox/{&}/g
  175. s/Poisson/{&}/g
  176. s/Chapman/{&}/g
  177. s/Kolmogorov/{&}/g
  178. s/Smirnov/{&}/g
  179. s/Weiner/{&}/g
  180. s/Hopf/{&}/g
  181. s/Stirling/{&}/g
  182.  
  183. # computing
  184. s/Buzen/{&}/g
  185. s/Gordon/{&}/g
  186. s/Newell/{&}/g
  187. s/Lemoine/{&}/g
  188. s/Pierce/{&}/g
  189. s/Harrison/{&}/g
  190. s/Cambridge/{&}/g
  191. s/Ethernet/{&}/g
  192. s/Aloha/{&}/g
  193.  
  194. # coding theory
  195. s/Hamming/{&}/g
  196. s/Huffman/{&}/g
  197. s/Reed/{&}/g
  198. s/Shannon/{&}/g
  199. s/Solomon/{&}/g
  200. s/Viterbi/{&}/g
  201.